<%@ page language="java" contentType="text/html; charset=utf-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>入住&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</title>
<link href="${ctx}/styles/public.css" rel="stylesheet" type="text/css">
<link href="${ctx}/styles/listTable.css" rel="stylesheet" type="text/css">
<link href="${ctx}/styles/aux_window.css" rel="stylesheet" type="text/css">

<script language="JavaScript" type="text/javascript" src="${ctx}/scripts/public.js"></script>
<script language="JavaScript"  src="${ctx}/scripts/jscalendar-1.0/calendar.js"></script>
<script language="JavaScript"  src="${ctx}/scripts/jscalendar-1.0/lang/calendar-en.js"></script>
<script language="JavaScript"  src="${ctx}/scripts/jscalendar-1.0/calendar-setup.js"></script>
<script language="JavaScript"  src="${ctx}/scripts/div/common.js"></script>
<script language="JavaScript"  src="${ctx}/scripts/common/prototype.js"></script>

<link href="${ctx}/scripts/jscalendar-1.0/calendar-blue.css" rel="stylesheet" type="text/css">
<link href="${ctx}/scripts/jscalendar-1.0/calendar-blue2.css" rel="stylesheet" type="text/css">
<%@ include file="/commons/validation.jsp" %>
<script type="text/javascript" language="JavaScript">
	function openSelectTenement(){
		var parentFrm = findFrame("main");
		var houseId = parentFrm.getHouseId();
		var customerId = parentFrm.getCustomerId();
		var url = "${ctx}/customer_customerAction.do?method=initCustomerChoose&houseId=" + houseId+ "&customerId=" + customerId;
		windowOpen(url,"selectTenement","选择住户",340,400);
	}

	function setCustomer(customer){
		$('ownerOrLessee').value = customer;
	}
	function setHouseNumber(houseNumber){
		$('houseNumbers').innerText = houseNumber;
	}

	function submitFrom(){
		var flag = document.all.customerLiveIn.fireEvent("onSubmit");
		if(flag){
			var pars = $('customerLiveIn').serialize();
			var url = "${ctx}/customer_customerAction.do?method=customerLiveIn";
			new Ajax.Request(url,
		                    {method: 'post', parameters: pars, onComplete: showResponse}
		                    );
	    }
	}

	function showResponse(){
		findFrame("main").reloadFrame();
		windowClose();
	}
</script>
</head>

<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td class="window_head_outBg"><table border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td><img src="${ctx}/images/ico_Advance.gif" width="16" height="16" align="absmiddle"> <span class="window_head_intext">入住</span></td>
        </tr>
    </table></td>
  </tr>
  <tr>
    <td class="aux_header_line_1"></td>
  </tr>
  <tr>
    <td class="aux_header_line_2"></td>
  </tr>
  <tr>
    <td class="content"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>

      	<form id="customerLiveIn" action="${ctx}/customer_customerAction.do?method=customerLiveIn" method="post" class="required-validate">
		<input type="hidden" id="sysDate" name="sysDate" value="<fmt:formatDate value="${sysDate}" pattern="yyyy-MM-dd"/>">
        <td class="aux_outtable_color">
        <table width="100%" border="0" cellpadding="0" cellspacing="1" class="aux_intable_color">
            <tr>
              <td class="aux_intable_td1">
             	 <c:if test="${customerLinve_customerType eq 'owner'}">
             	 	 住户：
             	 </c:if>
             	 <c:if test="${customerLinve_customerType eq 'lessee'}">
             	 	 住户：
             	 </c:if>
              </td>
              <td class="aux_intable_require"><table border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td ><input id="ownerOrLessee" maxlength="80" name="ownerOrLessee" readonly="readonly" type="text" class="inputtext required" afterInsert="img_move_in" value="" size="16"></td>
                    <td width="4">&nbsp;</td>
                    <td><a href="#"  onClick="openSelectTenement();" onFocus="this.blur()"><img src="${ctx}/images/ico_seachman.gif" width="16" height="16" border="0"></a><span id="img_move_in"></span></td>
                  </tr>
              </table></td>
            </tr>
            <tr>
              <td class="aux_intable_td1">房号：</td>
              <td class="aux_intable_require"><div id="houseNumbers"></div></td>
            </tr>
            <tr>
              <td class="aux_intable_td1">入住日期：</td>
              <td class="aux_intable_require"><table border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td ><input id="moveInDate" name="moveInDate" type="text" class="inputtext required validate-date less-equals-than-sysDate" validateMessage="输入日期必须小于或等于系统当前日期" afterInsert="img_sysDate" value="<fmt:formatDate value="${sysDate}" pattern="yyyy-MM-dd"/>" size="16"></td>
                    <td width="4">&nbsp;</td>
                    <td><img id="img_sysDate" src="${ctx}/images/ico_clock.gif" width="20" height="20"></td>
                  </tr>
              </table></td>
            </tr>
        </table></td>
      </tr>
    </table></td>
     </form>
  </tr>
  <tr>
    <td class="window_footer"><table border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td><table border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td class="buttonOffLeft" id="btn1_21"></td>
              <td class="buttonOffMiddle" id="btn1_22" onClick="submitFrom();" onMouseOver="btn_change_over(2)" onMouseOut="btn_change_out(2)" onblur="btn_change(2)"><img src="${ctx}/images/ico_ok.gif" alt="" width="14" height="14" border="0" align="absbottom">确 定</td>
              <td class="buttonOffRight" id="btn1_23"></td>
            </tr>
        </table></td>
        <td class="btn_between_space"></td>
        <td><table border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td class="buttonOffLeft" id="btn1_31"></td>
              <td class="buttonOffMiddle" id="btn1_32" onClick="windowClose();" onMouseOver="btn_change_over(3)" onMouseOut="btn_change_out(3)" onblur="btn_change(3)"><img src="${ctx}/images/ico_cancel.gif" alt="" width="14" height="14" border="0" align="absbottom">取 消</td>
              <td class="buttonOffRight" id="btn1_33"></td>
            </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
</table>
<script type="text/javascript">
			//入住日期
              Calendar.setup(
              {
	              inputField : "moveInDate", // ID of the input field
	              ifFormat : "%Y-%m-%d", // the date format
	              button : "img_sysDate", // ID of the button
	              align          :    "Tl",           // alignment (defaults to "Bl")
			      singleClick    :    true
              }
              );
</script>
</body>
</html>